﻿
/*----------------------------------------------------------------//
// 文件名：MoTestRecord.cs
// 文件功能描述：实体 MoTestRecord.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTestRecord
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoTestRecord
    /// </summary>
    public partial class MoTestRecord : ICloneable
    {
        #region 表TestRecord的字段
        private string trId;
        private string coItemId;
        private string refFtId;
        private string trUrl;
        private string reportSliceUrl;
        #endregion

        #region 构造函数
        public MoTestRecord()
        {


        }
        #endregion

        #region 拷贝构造函数

        public MoTestRecord(MoTestRecord item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoTestRecord(string trId, string coItemId, string refFtId, string trUrl, string reportSliceUrl)
        {
            this.trId = trId;
            this.coItemId = coItemId;
            this.refFtId = refFtId;
            this.trUrl = trUrl;
            this.reportSliceUrl = reportSliceUrl;
        }
        #endregion

        #region 表TestRecord的字段属性
        /// <summary>
        /// TR_ID
        /// </summary>
        public string TrId
        {
            get { return trId; }
            set { trId = value; }
        }
        /// <summary>
        /// CO_ITEM_ID
        /// </summary>
        public string CoItemId
        {
            get { return coItemId; }
            set { coItemId = value; }
        }
        /// <summary>
        /// REF_FT_ID
        /// </summary>
        public string RefFtId
        {
            get { return refFtId; }
            set { refFtId = value; }
        }
        /// <summary>
        /// TR_URL
        /// </summary>
        public string TrUrl
        {
            get { return trUrl; }
            set { trUrl = value; }
        }
        /// <summary>
        /// REPORT_SLICE_URL
        /// </summary>
        public string ReportSliceUrl
        {
            get { return reportSliceUrl; }
            set { reportSliceUrl = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoTestRecord CopyTo(MoTestRecord item)
        {
            item.trId = this.trId;
            item.coItemId = this.coItemId;
            item.refFtId = this.refFtId;
            item.trUrl = this.trUrl;
            item.reportSliceUrl = this.reportSliceUrl;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoTestRecord mo = new MoTestRecord();
            mo.TrId = this.TrId;
            mo.CoItemId = this.CoItemId;
            mo.RefFtId = this.RefFtId;
            mo.TrUrl = this.TrUrl;
            mo.ReportSliceUrl = this.ReportSliceUrl;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoTestRecord NewTestRecord = obj as MoTestRecord;
                if (NewTestRecord == null)
                {
                    return false;
                }
                else
                {
                    if (NewTestRecord.TrId == this.TrId && NewTestRecord.CoItemId == this.CoItemId && NewTestRecord.RefFtId == this.RefFtId && NewTestRecord.TrUrl == this.TrUrl && NewTestRecord.ReportSliceUrl == this.ReportSliceUrl)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "TrId={0}/CoItemId={1}/RefFtId={2}/TrUrl={3}/ReportSliceUrl={4}", trId, coItemId, refFtId, trUrl, reportSliceUrl);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["TR_ID"] != null && row["TR_ID"] != DBNull.Value)
            {
                this.TrId = (string)row["TR_ID"];
            }
            else
            {
                this.TrId = string.Empty;
            }
            if (row["Co_Item_ID"] != null && row["Co_Item_ID"] != DBNull.Value)
            {
                this.CoItemId = (string)row["Co_Item_ID"];
            }
            else
            {
                this.CoItemId = string.Empty;
            }
            if (row["REF_FT_ID"] != null && row["REF_FT_ID"] != DBNull.Value)
            {
                this.RefFtId = (string)row["REF_FT_ID"];
            }
            else
            {
                this.RefFtId = string.Empty;
            }
            if (row["TR_URL"] != null && row["TR_URL"] != DBNull.Value)
            {
                this.TrUrl = (string)row["TR_URL"];
            }
            else
            {
                this.TrUrl = string.Empty;
            }
            if (row["Report_Slice_URL"] != null && row["Report_Slice_URL"] != DBNull.Value)
            {
                this.ReportSliceUrl = (string)row["Report_Slice_URL"];
            }
            else
            {
                this.ReportSliceUrl = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["TR_ID"] = this.TrId;
            row["Co_Item_ID"] = this.CoItemId;
            row["REF_FT_ID"] = this.RefFtId;
            row["TR_URL"] = this.TrUrl;
            row["Report_Slice_URL"] = this.ReportSliceUrl;
        }
        #endregion
    }
}
#endregion
